//
//  NewFeatureViewController.m
//  TenThousand
//
//  Created by 王 on 16/7/31.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "NewFeatureViewController.h"

#import "CollectionViewCell.h"
#import "UIView+Ext.h"

#define CZBKCollectionViewCellCount 3

@interface NewFeatureViewController ()
@property (nonatomic, weak) UIImageView* imgViewIcon;
@property (nonatomic, weak) UIImageView* imgViewLarge;
@property (nonatomic, weak) UIImageView* imgViewSmall;

@end

@implementation NewFeatureViewController
static NSString* const reuseIdentifier = @"guide_cell";

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor redColor];
    [self.collectionView registerClass:[CollectionViewCell class] forCellWithReuseIdentifier:reuseIdentifier];
    self.collectionView.showsHorizontalScrollIndicator = NO;
    self.collectionView.bounces = NO;
    self.collectionView.pagingEnabled = YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (instancetype)init
{
    
    UICollectionViewFlowLayout* flowLayout = [[UICollectionViewFlowLayout alloc] init];
    flowLayout.itemSize = [UIScreen mainScreen].bounds.size;
    flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    flowLayout.minimumLineSpacing = 0;
    
    return [super initWithCollectionViewLayout:flowLayout];
}

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView*)collectionView
{
    return 1;
}

- (NSInteger)collectionView:(UICollectionView*)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 3;
}

- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView cellForItemAtIndexPath:(NSIndexPath*)indexPath
{
    
    CollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];
    
    if(indexPath.row == 0) {
        cell.image = [UIImage imageNamed:@"loading1-1334"];
    } else if (indexPath.row == 1) {
        cell.image = [UIImage imageNamed:@"loading2-1334"];
    } else {
        cell.image = [UIImage imageNamed:@"loading3-1334"];
    }
    
    [cell setStartButtonVisibleWithIndex:(int)indexPath.row count:CZBKCollectionViewCellCount];
    
    return cell;
    
    
}



@end
